﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Cesave.Domain.PermisosModule.Entities;
using Cesave.Infrastructure.Data.PermisosModule.Context;
using Cesave.Infrastructure.CrossCutting.Logging;
using Cesave.Domain.PermisosModule.Contracts.FoliosPermisos;
using Cesave.Infrastructure.Data.PermisosModule.Repositories;

namespace Cesave.Infrastructure.Data.PermisosModule.Tests.RepositoriesTests
{
	[TestClass]
	public class FoliosPermisoRepositoryTests
		: GenericRepositoryTestsBase<FoliosPermiso>
	{
		public override System.Linq.Expressions.Expression<Func<FoliosPermiso, bool>> FilterExpression
		{
			get
			{
				return f => f.JuntaId == 2;
			}
		}

		public override System.Linq.Expressions.Expression<Func<FoliosPermiso, int>> OrderByExpression
		{
			get
			{
				return f => f.Folio;
			}
		}

		[TestMethod]
		[ExpectedException(typeof(ArgumentNullException))]
		public void FindFoliosPermisoByJuntaAndCicloAndArea_Null_Specification_Throws_ArgumentNullException()
		{
			// Arrange
			IPermisosModuleContext context = GetContext();
			ITraceManager traceManager = GetTraceManager();
			IFoliosPermisoRepository repository = new FoliosPermisoRepository(context, traceManager);

			// Act
			var actual = repository.FindFoliosPermisoByJuntaAndCicloAndArea(null);
		}

	}
}